<template>
  <!-- 字体图标组件 参数：icon字体类型 -->
  <i class="iconfont icon" :class="compIcon"></i>
</template>

<script>
// 对应字体地图
let obj = {
  home: "icon-home",
  aboutMe: "icon-user",
  myArticle: "icon-file",
  myProject: "icon-code",
  weChat: "icon-weixin",
  QQ: "icon-logo-qq",
  Email: "icon-tubiao209",
  Github: "icon-gitee2",
  liuYan: "icon-comment",
  user: "icon-custom-user",
  daohang: "icon-daohangfenlei",
  liuY: "icon-liuyan",
  look: "icon-biaoqiankuozhan_yuedu-119",
  time: "icon-time",
  hot: "icon-remen",
  shenfen: "icon-shenfenrenzheng",
  biaoqian: "icon-biaoqian",
  jinggao: "icon-jinggao",
  syy: "icon-shangyiye",
  xyy: "icon-xiayiye",
  dyy: "icon-shangyiye1",
  zhyy: "icon-xiayiye1",
};
import { computed, ref } from "vue";
export default {
  props: {
    icon: String,
  },

  setup(prop) {
    let iconMap = ref(obj);
    let compIcon = computed(() => {
      return iconMap.value[prop.icon] || "";
    });

    return {
      iconMap,
      compIcon,
    };
  },
};
</script>

<style scoped>
@import "https://at.alicdn.com/t/font_2780879_ldxzbizo2p.css";
</style>
